#!/usr/bin/env python
# encoding: utf-8
# @author: Lin Han
# @contact: voldemort22@126.com
# @file: configs.py
# @time: 2021/3/29 10:58
# @desc:

NUMBER_HISTORY_CLAMP_START = 2021010000001001
NUMBER_HISTORY_PART_START = 2021020000001001
NUMBER_STANDARD_CLAMP_START = 2021030000001001
NUMBER_STANDARD_PART_START = 2021040000001001
NUMBER_PARAMETER_MODEL_START = 2021050000001001
NUMBER_SCENE_START = 2021060000001001

MQ_URL = "69.231.139.11"
QUEUE = "upload2oss"
TRANSFER_FORMAT_QUEUE = "upload2oss"
UPDATE_DATA_QUEUE = "oss2upload"
MQ_ACCOUNT = "admin"
MQ_PASSWORD = "rabbitmq666"
MQ_PORT = 5672

BACKEND_IP = "161.189.75.127"
# MONGO_URL = "mongodb://69.231.130.231:27017/"
# MONGO_URL = "mongodb://69.231.129.214:27017/"

REDIS_IP = BACKEND_IP
# REDIS_IP = "localhost"
REDIS_PORT = 6379

MONGO_ACCOUNT = "linhan"
MONGO_PASSWORD = "linhan1987"
# MONGO_IP = "69.230.245.72"
MONGO_IP = BACKEND_IP
MONGO_PORT = 27017
MONGO_DATABASE = "do_center"

# MONGO_URL = f"mongodb://{BACKEND_IP}:27017/"
MONGO_URL = f'mongodb://{MONGO_ACCOUNT}:{MONGO_PASSWORD}@{MONGO_IP}:{MONGO_PORT}/'
MONGO_DATABASE_NAME = "do_center"

HISTORY_CLAMP_COLLECTION = "history_clamp"
HISTORY_PART_COLLECTION = "history_part"
STANDARD_CLAMP_COLLECTION = "standard_clamp"
STANDARD_PART_COLLECTION = "standard_part"
PARAMETER_MODEL_COLLECTION = "parameter_model"
SCENE_COLLECTION = "scene"
FACTORY_STANDARD_COLLECTION = "factory_standard"

RELATION_01_03_COLLECTION = "01_03_relation"
RELATION_02_04_COLLECTION = "02_04_relation"
RELATION_02_05_COLLECTION = "02_05_relation"
RELATION_04_05_COLLECTION = "04_05_relation"

# BACKEND_URL = "69.230.245.72"
BACKEND_PORT = 18000
CONSUME_QUEUE = 'oss2upload'

# message queue list
DEFAULT_QUEUE = "general_transfer"
HISTORY_CLAMP_QUEUE = "history_clamp_catpart2gltf"
HISTORY_PART_QUEUE = "history_part_catpart2gltf"
STANDARD_CLAMP_QUEUE = "standard_clamp_json2stl"
STANDARD_PART_QUEUE = "standard_part_json2stl"
PARAMETER_MODEL_QUEUE = "parameter_model_catpart2gltf"

STANDARD_PART_CHANGE_SIZE_QUEUE = "temporary_json2stl_return"

# HISTORY_CLAMP_RETURN_QUEUE = "history_clamp_return"
# HISTORY_PART_RETURN_QUEUE = "history_part_return"
# STANDARD_CLAMP_RETURN_QUEUE = "standard_clamp_return"
# STANDARD_PART_RETURN_QUEUE = "standard_part_return"
# PARAMETER_MODEL_RETURN_QUEUE = "parameter_model_return"

# credentials = pika.PlainCredentials(MQ_ACCOUNT, MQ_PASSWORD)
# parameters = pika.ConnectionParameters(MQ_URL, MQ_PORT, "/", credentials)
# connection = pika.BlockingConnection(parameters)
# channel = connection.channel()
TEMPORARY_CONVERT_MACHINE_URL = "69.230.251.97"
TEMPORARY_CONVERT_MACHINE_PORT = 8000

# AliOss相关的一系列常量
CATPART_OSS_ADDRESS = "catpartAliOssAddress"
STP_OSS_ADDRESS = "stpAliOssAddress"
STL_OSS_ADDRESS = "stlAliOssAddress"
GLTF_OSS_ADDRESS = "gltfAliOssAddress"
JSON_OSS_ADDRESS = "jsonAliOssAddress"

WORKPIECE_CATPART_OSS_ADDRESS = "workpieceCatpartAliOssAddress"
WORKPIECE_STP_OSS_ADDRESS = "workpieceStpAliOssAddress"
WORKPIECE_STL_OSS_ADDRESS = "workpieceStlAliOssAddress"
WORKPIECE_GLTF_OSS_ADDRESS = "workpieceGltfAliOssAddress"

#
# # AWS相关的一系列常量
# CATPART_OSS_ADDRESS = "catpartAWSAddress"
# STP_OSS_ADDRESS = "stpAWSAddress"
# STL_OSS_ADDRESS = "stlAWSAddress"
# GLTF_OSS_ADDRESS = "gltfAWSAddress"
# JSON_OSS_ADDRESS = "jsonAWSAddress"
#
# WORKPIECE_CATPART_OSS_ADDRESS = "workpieceCatpartAWSAddress"
# WORKPIECE_STP_OSS_ADDRESS = "workpieceStpAWSAddress"
# WORKPIECE_STL_OSS_ADDRESS = "workpieceStlAWSAddress"
# WORKPIECE_GLTF_OSS_ADDRESS = "workpieceGltfAWSAddress"
